package com.jlc.o2o.enums;

public enum ShopSateEnum {
    CHECK(0, "审核中"), OFFLINE(-1, "非法店铺"),SUCCESS(1, "操作成功"),NULL_SHOP(2, "店铺不存在");

    private int state;
    private String stateInfo;

    private ShopSateEnum(int state, String stateInfo){
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /**
     * 依据传入的state返回相应的enum值
     */
    public static ShopSateEnum stateOf(int state){
        for(ShopSateEnum shopSateEnum:values()){
            if(shopSateEnum.getState() == state){
                return shopSateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }


    public String getStateInfo() {
        return stateInfo;
    }
}
